MkImageCompare
Node to show an Image comparison (using a slider).¶
Example: Regular¶
Bases: MkTemplate
Name | Children | Inherits |
---|---|---|
MkTemplate mknodes.templatenodes.mktemplate Node representing a jinja template. |
graph TD
94272697541280["mkimagecompare.MkImageCompare"]
94272697537520["mktemplate.MkTemplate"]
94272697822880["mkcontainer.MkContainer"]
94272697820320["mknode.MkNode"]
94272697777776["node.Node"]
139836355973312["builtins.object"]
94272697537520 --> 94272697541280
94272697822880 --> 94272697537520
94272697820320 --> 94272697822880
94272697777776 --> 94272697820320
139836355973312 --> 94272697777776
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkimagecompare/metadata.toml
[metadata]
icon = "mdi:image-off"
name = "MkImageCompare"
group = "image"
[[resources.js]]
link = "https://unpkg.com/img-comparison-slider@7/dist/index.js"
defer = true
[[resources.css]]
filename = "https://unpkg.com/img-comparison-slider@7/dist/styles.css"
[examples.regular]
title = "Regular"
jinja = """
{{ "https://picsum.photos/700" | MkImageCompare(after_image="https://picsum.photos/701") }}
"""
[output.html]
template = """
<img-comparison-slider>
<img src="{{ node.before_image }}" slot="first">
<img src="{{ node.after_image }}" slot="second">
</img-comparison-slider>
"""